Skip to content

Implement dark mode with persistent user preference - #5046

Open
anshul23102 wants to merge 1 commit into
codeharborhub:mainfrom
anshul23102:feat/5025-dark-mode
Open

Implement dark mode with persistent user preference#5046
anshul23102 wants to merge 1 commit into
codeharborhub:mainfrom
anshul23102:feat/5025-dark-mode

Conversation

@anshul23102

@anshul23102 anshul23102 commented Jul 27, 2026

Copy link
Copy Markdown

Adds comprehensive dark mode support with automatic theme persistence and system preference detection.

Features:

  • Persistent theme preference stored in localStorage
  • Automatic system color scheme detection (respects prefers-color-scheme)
  • Smooth color transitions for better UX
  • useColorMode hook for component integration
  • ThemeToggle component with keyboard accessibility
  • Complete documentation with developer guide

Configuration:

  • colorMode enabled with localStorage persistence
  • respectPrefersColorScheme respects system preference as fallback
  • All CSS variables support light/dark variants

Components:

  • useColorMode hook for managing theme state
  • ThemeToggle button for manual switching
  • Enhanced custom.css with transition effects

Closes #5025

…hub#5025)

Add comprehensive dark mode support with automatic theme persistence:
- docusaurus.config.js: Add colorMode config for localStorage persistence and system preference detection
- useColorMode.js: Custom hook for accessing/managing color mode in components
- ThemeToggle.jsx: Theme toggle component with accessible icon buttons
- ThemeToggle.module.css: Styled toggle with smooth transitions and hover effects
- dark-mode.mdx: Complete documentation with usage examples and API reference
- custom.css: Enhanced with smooth color transitions respecting prefers-reduced-motion

Features:
- Automatic system preference detection (respects prefers-color-scheme media query)
- Manual theme toggle with localStorage persistence
- Smooth color transitions for better UX
- ARIA labels and keyboard accessibility
- Complete component and page coverage
- Developer-friendly hook API

Theme preference is saved in localStorage and restored on next visit.
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job, @anshul23102! 🎉 Thank you for submitting your pull request to CodeHarborHub. We appreciate your contribution and enthusiasm! Our team will review it soon. If you have any questions or need further assistance, feel free to reach out. Thanks for contributing!

@deepsource-io

deepsource-io Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

DeepSource Code Review

We reviewed changes in d148591...23f427d on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Jul 27, 2026 6:03p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@github-actions

Copy link
Copy Markdown

⚡️ Lighthouse Report for the Deploy Preview of this PR 🚀

🔗 Site: CodeHarborHub | Live Site

URL 🌐 Performance Accessibility Best Practices SEO 📊
/ 🔴 27 🟡 77 🟡 75 🟢 100 📄
/docs 🔴 47 🟡 87 🟢 96 🟢 100 📄
/courses 🟡 55 🟡 86 🟢 96 🟢 100 📄
/showcase 🟡 51 🟡 87 🟡 75 🟡 86 📄
/community 🟡 56 🟡 86 🟢 96 🟢 100 📄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add dark mode with persistent user preference

1 participant